package com.ltedu.system.domain.vo;

import com.ltedu.common.validate.Create;
import com.ltedu.common.validate.Update;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.List;

/**
 * @className: UserVO
 * @auther: Jerry
 * @date: 2020/11/27 20:17
 * @desctiption: TODO
 * @version: 1.0
 */
public class SysUserVO implements Serializable {
    private static final long serialVersionUID = 4580237603263289837L;
    @NotNull(groups = Update.class, message = "id不能为空")
    private Long id;
    /**用户名*/
    @NotEmpty(groups = Create.class, message = "用户名不能为空")
    @NotEmpty(groups = Update.class, message = "用户名不能为空")
    @Pattern(regexp = "[a-zA-Z][a-zA-Z0-9]{5,15}", groups = Create.class, message = "用户名由英文字母和数字组成的6-16位字符")
    @Pattern(regexp = "[a-zA-Z][a-zA-Z0-9]{5,15}", groups = Update.class, message = "用户名由英文字母和数字组成的6-16位字符")
    private String username;
    /**手机号*/
    private String mobile;
    /**性别(0男 1女 2未知)*/
    @NotNull(groups = Create.class, message = "性别不能为空")
    @NotNull(groups = Update.class, message = "性别不能为空")
    private Integer sex;
    /**真实姓名*/
    private String realName;
    /**密码*/
    @NotEmpty(groups = Create.class, message = "密码不能为空")
    private String password;
    /**状态(1:正常，0:禁用)*/
    @NotNull(groups = Create.class, message = "用户状态不能为空")
    @NotNull(groups = Update.class, message = "用户状态不能为空")
    private Integer state;
    /**头像*/
    private String avatar;
    /**备注*/
    private String remark;
    /**角色*/
    @NotNull(groups = Create.class, message = "角色不能为空")
    @NotNull(groups = Update.class, message = "角色不能为空")
    private List<Long> roleIds;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<Long> getRoleIds() {
        return roleIds;
    }

    public void setRoleIds(List<Long> roleIds) {
        this.roleIds = roleIds;
    }
}
